package com.quanyan.stadium.enums;


/**
 * Created by xiaoxiao on 16/6/2.
 *
 * 网球不固定打发,设计为5-8人
 */
public enum GameSystemUnsetDoubleConfigEnum{

    CONFIG_GAME_TYPE_DOUBLE_UNSET_FIVE(1, 5, 6,"5人双打"),
    CONFIG_GAME_TYPE_DOUBLE_UNSET_SIX(2, 6, 6,"6人双打"),
    CONFIG_GAME_TYPE_DOUBLE_UNSET_SEVEN(3, 7, 8,"7人双打"),
    CONFIG_GAME_TYPE_DOUBLE_UNSET_EIGHT(4, 8, 8,"8人双打");


    private int id;

    private int teamNum;

    private int roundNum;

    private String desc;

    GameSystemUnsetDoubleConfigEnum(int id, int teamNum, int roundNum, String desc){
        this.id = id;
        this.teamNum = teamNum;
        this.roundNum = roundNum;
        this.desc = desc;
    }

    public int getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getTeamNum() {
        return teamNum;
    }

    public void setTeamNum(int teamNum) {
        this.teamNum = teamNum;
    }

    public int getRoundNum() {
        return roundNum;
    }

    public void setRoundNum(int roundNum) {
        this.roundNum = roundNum;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static int getRoundNumByTeamNum(int teamNum){
        for (GameSystemUnsetDoubleConfigEnum tmpEnum : GameSystemUnsetDoubleConfigEnum.values()) {
            if (tmpEnum.getTeamNum() == teamNum) {
                return tmpEnum.getRoundNum();
            }
        }
        return -1;
    }
}
